define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'admin/paymentAccount/index?type=' + window.paymentAccountType,
        add_url: 'admin/paymentAccount/add?type=' + window.paymentAccountType,
        edit_url: 'admin/paymentAccount/edit?type=' + window.paymentAccountType,
        delete_url: 'admin/paymentAccount/delete?type=' + window.paymentAccountType,
        export_url: 'admin/paymentAccount/export?type=' + window.paymentAccountType,
        modify_url: 'admin/paymentAccount/modify?type=' + window.paymentAccountType,
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar: ['refresh', 'add'],
                cols: [[
                    {field: 'id', title: 'ID', search: false},
                    {field: 'name', title: '商户名称'},
                    {field: 'mchid', title: '商户号'},
                    {field: 'create_time', title: '创建时间', search: false},
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };

    return Controller;
});